<template>
    <div>
         
        <TypeNav :isShow="true"/>
        <!--列表-->
        <template v-if='banner.length'>
             <List :banner='banner'/>
        </template>
        <!--今日推荐-->
        <Recommend/>
        <!-- 商品排行 -->
        <Rank/>
        <!-- 猜你喜欢 -->
        <Like/>
        <!--楼层-->
        
        <!--楼层-->
        <Floor :floor="item" v-for="item in floors" :key="item.id"/>
        <!--商标-->
        <Brand/>
    </div>
</template>
<script>
import List from './List/'
import Recommend from './Recommend/'
import Rank from './Rank/'
import Like from './Like/'
import Brand from './Brand/'
import Floor from './Floor/'
export default {
    name:'Home',
    components:{
        List,
        Recommend,
        Rank,
        Like,
        Brand,
        Floor
    }, 
    mounted(){
        this.$store.dispatch('getBanner')
        this.$store.dispatch('getFloor')
    },
    computed:{
        banner(){ 
            return this.$store.state.home.banners
        },
        floors(){
             return this.$store.state.home.floors
        }
    }
}
</script>
<style scoped lang='less'>
    

   
    
</style>